--- title: "健身" created: 2025-11-28 tags: - 算法 --- # 健身 ## 题目 [健身](https://www.acwing.com/problem/content/4797/) ![[2f63cc6e0ac3b9fc6f105f95e5457596-2f63cc6e.png]] ## 思路分析 ## 代码实现 ```cpp #include using namespace std; #define endl '\n' int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n;cin>>n; long long chest=0,biceps=0,back=0; for(int i=1;i<=n;i++){ int temp;cin>>temp; if(i%3==1) chest+=temp; if(i%3==2) biceps+=temp; if(i%3==0) back+=temp; } long long maxnum=max(max(chest,biceps),back); if(maxnum==chest) cout<<"chest"<